﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="RuleResults.aspx.cs" Inherits="TM.Rules.Web.RuleResults" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    
    <script type="text/javascript">
        function expandDetailsInGrid(_this) {
            var id = _this.id;
            var imgelem = document.getElementById(_this.id);
            var currowid = id.replace("A_View", "TR_Summmary") //GETTING THE ID OF SUMMARY ROW

            var rowdetelemid = currowid;
            var rowdetelem = document.getElementById(rowdetelemid);
            if (imgelem.alt == "plus") {
                imgelem.src = "Images/minus.gif"
                imgelem.alt = "minus"
                rowdetelem.style.display = 'block';
            }
            else {
                imgelem.src = "Images/plus.gif"
                imgelem.alt = "plus"
                rowdetelem.style.display = 'none';
            }

            return false;

        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
  
    The results for the rule execution is available below.<br />
    <br />
    <table cellpadding="0" cellspacing="0" >
        <tr>
            <td >
                Select Rule:</td>
            <td>
    
                <asp:DropDownList ID="ddlRules" runat="server"  Width="342px">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td >
                Select Date</td>
            <td>
                <asp:Calendar ID="dtpDate" runat="server">
                    <SelectedDayStyle BackColor="Blue" />
                </asp:Calendar>
  
            </td>
        </tr>
        <tr>
            <td >
                &nbsp;</td>
            <td>
                <asp:Button ID="btnShow" runat="server" Text="Show" Width="70px" 
                    onclick="btnShow_Click" />
            </td>
        </tr>
        
        <tr>
            <td colspan="2" align="left">
                <asp:GridView ID="GV_ExpandRow" runat="server" 
            style="border-width:thin; border-color:#101010; " 
            HeaderStyle-BackColor="#5D7B9D" AutoGenerateColumns="False" Width="800px">
        <Columns>
       <asp:TemplateField>
       <ItemTemplate>
       <asp:ImageButton OnClientClick="expandDetailsInGrid(this);return false;"
        runat="server" ID="A_View" ImageUrl="Images/plus.gif"  AlternateText="plus" />
       </ItemTemplate>
       </asp:TemplateField>
        <asp:BoundField DataField="Symbol" HeaderText="Symbol" />
   
      <%--  <asp:BoundField DataField="Action" HeaderText="Action" />--%>
     
       <asp:BoundField DataField="Company" HeaderText="Company Name" />
          <asp:BoundField DataField="LastPrice" HeaderText="Last Price" />
          <asp:BoundField DataField="Volume" HeaderText="Volume" />
        <asp:TemplateField HeaderText="LastPrice">
        <ItemTemplate>
       
        </td></tr>
        
        <tr id="TR_Summmary" runat="server" style="display:none">
        <td colspan="7">
        <table border="0">
         <tr >  
        <td style="width:30px"></td>
            <td style="background-color:#999999;  font-weight:bold">
                AskPrice
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                HV1m
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                HV1mHigh52wk
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                HV1mLow52wk
            </td>
            <td style="background-color:#999999; font-weight:bold">
                HV1mYest
            </td>
             
        </tr>
         <tr>
                 <td></td>
                 <td>
           <asp:Label runat="server" ID="Label1" Text='<%#Eval("AskPrice")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label2" Text='<%#Eval("HV1m")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label3" Text='<%#Eval("HV1mHigh52wk")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label4" Text='<%#Eval("HV1mLow52wk")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label5" Text='<%#Eval("HV1mYest")%>' ></asp:Label>
        </td>
           </tr>
           

         <tr >  
        <td style="width:30px"></td>
            <td style="background-color:#999999;  font-weight:bold">
                IVX1m
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                IVX1mHigh52wk
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                IVX1mLow52wk
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                IVX1mYest
            </td>
            <td style="background-color:#999999; font-weight:bold">
                LastSize
            </td>
             
        </tr>
         <tr>
                 <td></td>
                 <td>
           <asp:Label runat="server" ID="Label6" Text='<%#Eval("IVX1m")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label7" Text='<%#Eval("IVX1mHigh52wk")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label8" Text='<%#Eval("IVX1mLow52wk")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label9" Text='<%#Eval("IVX1mYest")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label10" Text='<%#Eval("LastSize")%>' ></asp:Label>
        </td>
           </tr>


         <tr >  
        <td style="width:30px"></td>
            <td style="background-color:#999999;  font-weight:bold">
                OptionVolumeAvg
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                OptionVolumeCall
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                OptionVolumePut
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                OutstandingShares
            </td>
            <td style="background-color:#999999; font-weight:bold">
                PriceClose
            </td>
             
        </tr>
         <tr>
                 <td></td>
                 <td>
           <asp:Label runat="server" ID="Label11" Text='<%#Eval("OptionVolumeAvg")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label12" Text='<%#Eval("OptionVolumeCall")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label13" Text='<%#Eval("OptionVolumePut")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label14" Text='<%#Eval("OutstandingShares")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label15" Text='<%#Eval("PriceClose")%>' ></asp:Label>
        </td>
           </tr>


            <tr >  
        <td style="width:30px"></td>
            <td style="background-color:#999999;  font-weight:bold">
                PriceHigh52wk
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                PriceLow52wk
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                BullishCandlestickPatternFormed
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                BearishCandlestickPatternFormed
            </td>
            <td style="background-color:#999999; font-weight:bold">
                Volume
            </td>
             
        </tr>
         <tr>
                 <td></td>
                 <td>
           <asp:Label runat="server" ID="Label16" Text='<%#Eval("PriceHigh52wk")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label17" Text='<%#Eval("PriceLow52wk")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label18" Text='<%#Eval("BullishCandlestickPatternFormed")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label19" Text='<%#Eval("BearishCandlestickPatternFormed")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label20" Text='<%#Eval("Volume")%>' ></asp:Label>
        </td>
           </tr>

             <tr >  
        <td style="width:30px"></td>
            <td style="background-color:#999999;  font-weight:bold">
                RSI
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                Stochastic
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                MACDHistogram
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                MACDSignalLine
            </td>
            <td style="background-color:#999999; font-weight:bold">
                MACDLine
            </td>
             
        </tr>
         <tr>
                 <td></td>
                 <td>
           <asp:Label runat="server" ID="Label21" Text='<%#Eval("RSI")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label22" Text='<%#Eval("Stochastic")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label23" Text='<%#Eval("MACDHistogram")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label24" Text='<%#Eval("MACDSignalLine")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label25" Text='<%#Eval("MACDLine")%>' ></asp:Label>
        </td>
           </tr>

             <tr >  
        <td style="width:30px"></td>
            <td style="background-color:#999999;  font-weight:bold">
                CCI
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                ATR
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                BollingerUpperBand
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                BollingerMiddleBand
            </td>
            <td style="background-color:#999999; font-weight:bold">
                BollingerLowerBand
            </td>
             
        </tr>
         <tr>
                 <td></td>
                 <td>
           <asp:Label runat="server" ID="Label26" Text='<%#Eval("CCI")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label27" Text='<%#Eval("ATR")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label28" Text='<%#Eval("BollingerUpperBand")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label29" Text='<%#Eval("BollingerMiddleBand")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label30" Text='<%#Eval("BollingerLowerBand")%>' ></asp:Label>
        </td>
           </tr>

            <tr >  
        <td style="width:30px"></td>
            <td style="background-color:#999999;  font-weight:bold">
                EMA10d
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                SMA20day
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                SMA50day
            </td>
            <td style="background-color:#999999;  font-weight:bold">
                SMA200day
            </td>
           
             
        </tr>
         <tr>
                 <td></td>
                 <td align="left">
           <asp:Label runat="server" ID="Label31" Text='<%#Eval("EMA10d")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label32" Text='<%#Eval("SMA20day")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label33" Text='<%#Eval("SMA50day")%>' ></asp:Label>
        </td>
        <td>
           <asp:Label runat="server" ID="Label34" Text='<%#Eval("SMA200day")%>' ></asp:Label>
        </td>
      
           </tr>
           </table>
        </td>
        </tr>
        </ItemTemplate>
        </asp:TemplateField>
        </Columns>

<HeaderStyle BackColor="#5D7B9D" ForeColor="White"></HeaderStyle>
        </asp:GridView></td>
          
        </tr>
    </table>
    <br />
    


    
</asp:Content>
